API Documentation
ResourceManager.h
1 // ResourceManager.h
3 //
5 
6 namespace nkResources
7 {
22  class DLL_RESOURCES_EXPORT ResourceManager final : public nkCommon::SingletonClass<ResourceManager>
23  {
24  friend class nkCommon::SingletonClass<ResourceManager> ;
25 
26  private :
27 
28  // Functions
32  ResourceManager() ;
36  ~ResourceManager () ;
37 
38  public :
39 
40  // About working path
46  void setWorkingPath (const std::string_view& path) ;
52  void setWorkingPathAbsolute (const std::string_view& path) ;
56  const char* getWorkingPath () const ;
60  const char* getWorkingPathAbsolute () const ;
61 
62  // Launch path
66  const char* getLaunchedPath () const ;
72  void setLaunchedPath (const std::string_view& path) ;
73 
74  // Translations
82  std::string getRelativeFromAbsolute (const std::string_view& absolutePath) const ;
90  std::string getAbsoluteFromRelative (const std::string_view& relativePath) const ;
98  std::string getRelativeFromWorkingDir (const std::string_view& workingPath) const ;
106  std::string getAbsoluteFromWorkingDir (const std::string_view& workingPath) const ;
114  std::string getFromWorkingDirFromRelative (const std::string_view& relativePath) const ;
122  std::string getFromWorkingDirFromAbsolute (const std::string_view& absolutePath) const ;
123 
124  // Check folders
132  bool checkFileExists (const std::string_view& filePathAbs) const ;
140  void checkFolderExists (const char* path) ;
141 
142  // Loading
151  std::vector<unsigned char> loadFileIntoMemory (const std::string_view& filePathAbs, bool silent = false) ;
152  } ;
153 }
nkResources::ResourceManager::checkFileExists
bool checkFileExists(const std::string_view &filePathAbs) const
nkResources::ResourceManager::getRelativeFromAbsolute
std::string getRelativeFromAbsolute(const std::string_view &absolutePath) const
nkResources::ResourceManager::getAbsoluteFromRelative
std::string getAbsoluteFromRelative(const std::string_view &relativePath) const
nkResources::ResourceManager
Manager helping with path finding and resource loading.
Definition: ResourceManager.h:23
nkResources::ResourceManager::setWorkingPath
void setWorkingPath(const std::string_view &path)
nkResources::ResourceManager::getRelativeFromWorkingDir
std::string getRelativeFromWorkingDir(const std::string_view &workingPath) const
nkResources::ResourceManager::getAbsoluteFromWorkingDir
std::string getAbsoluteFromWorkingDir(const std::string_view &workingPath) const
nkResources::ResourceManager::loadFileIntoMemory
std::vector< unsigned char > loadFileIntoMemory(const std::string_view &filePathAbs, bool silent=false)
nkResources::ResourceManager::getWorkingPath
const char * getWorkingPath() const
nkResources::ResourceManager::getFromWorkingDirFromAbsolute
std::string getFromWorkingDirFromAbsolute(const std::string_view &absolutePath) const
nkResources::ResourceManager::setWorkingPathAbsolute
void setWorkingPathAbsolute(const std::string_view &path)
nkResources::ResourceManager::checkFolderExists
void checkFolderExists(const char *path)
nkResources::ResourceManager::getLaunchedPath
const char * getLaunchedPath() const
nkResources::ResourceManager::setLaunchedPath
void setLaunchedPath(const std::string_view &path)
nkResources::ResourceManager::getWorkingPathAbsolute
const char * getWorkingPathAbsolute() const
nkResources::ResourceManager::getFromWorkingDirFromRelative
std::string getFromWorkingDirFromRelative(const std::string_view &relativePath) const
nkResources
Encompasses all API of component NilkinsResources.
Definition: LogManager.h:7